﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microhard.WeixinMP.Interfaces;
using Microhard.WeixinMP.Models;

namespace Microhard.WeixinMP.Impls
{
    public class WXAlert : BaseResponseImpl
    {
        public override Interfaces.WeixinCommand Command
        {
            get
            {
                WeixinCommand cmm = new WeixinCommand();
                cmm.Event = "CLICK";
                return cmm;
            }
        }

        public override bool IsCallMe(Microhard.WeixinMP.Models.RequestServiceModel model)
        {
            if ("alert" == model.Event.Content.EventKey)
            {
                return true;
            }
            return false;
        }

        protected override Models.WeixinBaseData<object> CreateFeatureResponse(Models.RequestServiceModel request, Models.WeixinBaseData<object> response)
        {
            WeixinTxt welcome = new WeixinTxt();
            var currentAccount = request.WXMPAccountUser;
            welcome.Content = "根据您的登记资料，系统发现您的孩子漏种了甲肝，麻风疫苗，同时推荐您接种肺炎链球菌疫苗。<a href='http://121.199.31.20/ytym/customers/appointment/create'>您可以点击这里，进行接种预约</a>。";
            response.MsgType = WeixinMsgType.Text; ;
            response.Content = welcome;
            response.FuncFlag = WeixinMsgType.FuncFlag_False;
            return response;
        }
    }
}
